package com.xuexi.config;

import com.myrule.MySelfRule;
import com.xuexi.LB.MyLB;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.ribbon.RibbonClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

@Configuration
@RibbonClient(name = "CLOUD-PAYMENT-SERVICE",configuration = MyLB.class)//表示我们需要提供服务的服务名，负载均衡自定义的实现类
public class ApplicationContextConfig {
    @Bean
//    @LoadBalanced
    public RestTemplate getRestTemplate(){
        return new RestTemplate();
    }

}


